export const SEARCH_PARAMS = [
  { key: 'name', tag: 'a-input', conf: { label: '数据源', placeholder: '请输入数据源' } },
  { key: 'comment', tag: 'a-input', conf: { label: '数据源描述', placeholder: '请输入数据源描述' } },
  { key: 'host', tag: 'a-input', conf: { label: '域名/ip', placeholder: '请输入域名/ip' } },
  { key: 'port', tag: 'a-input-number', conf: { label: '数据库端口', placeholder: '请输入数据库端口' } },
  { key: 'schemaName', tag: 'a-input', conf: { label: '数据库名称', placeholder: '请输入数据库名称' } },
];

export const CUSTOM_BTN = [
  { name: '新增', code: 'add' },
  { name: '删除', code: 'delete' },
];

export const RULES = {
  name: [{ required: true, message: '数据源不能为空', trigger: ['change', 'blur'] }],
  comment: [{ required: true, message: '数据源描述不能为空', trigger: ['change', 'blur'] }],
  type: [{ required: true, message: '数据库类型不能为空', trigger: ['change', 'blur'] }],
  host: [{ required: true, message: '域名/ip不能为空', trigger: ['change', 'blur'] }],
  port: [{ required: true, message: '数据库端口不能为空', trigger: ['change', 'blur'] }],
  schemaName: [{ required: true, message: '数据库名称不能为空', trigger: ['change', 'blur'] }],
  username: [{ required: true, message: '数据库账号不能为空', trigger: ['change', 'blur'] }],
  password: [{ required: true, message: '数据库密码不能为空', trigger: ['change', 'blur'] }],
};
